package com.appkubes.mall.restful.application.activity.apply.dao;

import com.appkubes.mall.core.entity.MallGoodsTaobao;
import com.appkubes.mall.restful.application.activity.apply.entity.dto.ApplyListDTO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @Author: Lin Jiaming
 * @Date: 2020/3/6
 * @Description:
 */
@Mapper
public interface ApplyDao {
    @Select(
                "SELECT * FROM mall_activity_apply AS apply " +
                "LEFT JOIN mall_activity_goods AS activity_goods ON apply.activity_key=activity_goods.activity_key " +
                "LEFT JOIN mall_goods_taobao AS goods ON activity_goods.goods_key=goods.goods_key ${ew.customSqlSegment}"
            )
    IPage<ApplyListDTO> applyList(Page page,@Param(Constants.WRAPPER)QueryWrapper<MallGoodsTaobao> wrapper);
}
